// components/items/read-item.js
import helper from '../../utils/helper.js'
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    item: Object
  },

  /**
   * 组件的初始数据
   */
  data: {
    typeDate: [
      '', '阅读', '连载', '问答', '音乐', '影视'
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    navDetail: helper.throttle(function (e) {
      let id = e.currentTarget.dataset.id
      let type = e.currentTarget.dataset.type
      if (type == 1 || type == 2 || type == 5) {
        wx.navigateTo({
          url: `/pages/detail/detail?id=${id}&type=${type}`
        })
      } else if (type == 3) {
        wx.navigateTo({
          url: `/pages/detail/question?id=${id}&type=${type}`
        })
      }
      
    }, 1500)
  }
})
